#include <stdio.h>
#include <unistd.h>
#include "bashutils.h"

int main(void)
{
    printf("Hello World!\n");

    printf("test progress...\n");

    progress_t p;
    int ret = progress_init(&p, 0, 10);

    int i = 0;
    for (i = 0; i < 10; i++)
    {
        progress_show(&p, i + 1);
        sleep(1);
    }

    progress_destory(&p);

    printf("test status...\n");

    ret = status_stop();

    ret = status_start();
    status_destory();

    ret = status_init(1);
    ret = status_init(1);

    ret = status_start();
    ret = status_start();

    for (i = 0; i < 25; ++i)
    {
        sleep(1);
    }

    ret = status_destory();

    ret = status_stop();
    ret = status_stop();

    ret = status_destory();
    ret = status_destory();

    printf("test functions\n");

    echo_overlap("line 1");
    sleep(1);
    echo_overlap("line 2");
    sleep(1);
    echo_overlap("line 3");
    sleep(1);

    echo_info("common info");
    sleep(1);
    echo_info(" return\n");
    sleep(1);
    echo_warn("this is a warning");
    sleep(1);
    echo_warn(" return\n");
    sleep(1);
    echo_error("this is a error");
    sleep(1);
    echo_error(" return\n");
    sleep(1);
    echo_sucess("congurations");
    sleep(1);
    echo_sucess(" finished\n");
    sleep(1);
    echo_underline("this is a underline text");
    sleep(1);
    echo_info(", and this is a normal text\n");
    sleep(1);
    echo_reverse("this is a reversed text\n");
    sleep(1);

    return 0;
}

